
import { lazy } from 'react';
import { createBrowserRouter } from 'react-router-dom';

const Home = lazy(() => import('./pages/pc/Home'));
const Knowledge = lazy(() => import('./pages/pc/Knowledge'));
const Encyclopedia = lazy(() => import('./pages/pc/Knowledge/Encyclopedia'));
const Faq = lazy(() => import('./pages/pc/Knowledge/Faq'));
const Media = lazy(() => import('./pages/pc/Knowledge/Media'));
const VisionTest = lazy(() => import('./pages/pc/VisionTest'));
const Project = lazy(() => import('./pages/pc/Project'));
const ConnectUs = lazy(() => import('./pages/pc/ConnectUs'));

const MobileHome = lazy(() => import('./pages/mobile/Home'));
const MobileKnowledge = lazy(() => import('./pages/mobile/Knowledge'));
const MobileVisionTest = lazy(() => import('./pages/mobile/VisionTest'));
const MobileProject = lazy(() => import('./pages/mobile/Project'));
const MobileConnectUs = lazy(() => import('./pages/mobile/ConnectUs'));

const router = createBrowserRouter([
  {
    path: '/',
    element: <Home />,
  },
  {
    path: '/knowledge',
    element: <Knowledge />,
    children: [
      {
        path: 'encyclopedia',
        element: <Encyclopedia />
      },
      {
        path: 'faq',
        element: <Faq />
      },
      {
        path: 'media',
        element: <Media />
      }
    ]
  },
  {
    path: '/vision-test',
    element: <VisionTest />,
  },
  {
    path: '/project',
    element: <Project />,
  },
  {
    path: '/connect-us',
    element: <ConnectUs />,
  },
  {
    path: '/mobile',
    element: <MobileHome />,
  },
  {
    path: '/mobile/knowledge',
    element: <MobileKnowledge />,
    children: [
      {
        path: 'encyclopedia',
      },
      {
        path: 'faq',
      },
      {
        path: 'media',
      }
    ]
  },
  {
    path: '/mobile/vision-test',
    element: <MobileVisionTest />,
  },
  {
    path: '/mobile/project',
    element: <MobileProject />,
  },
   {
    path: '/mobile/connect-us',
    element: <MobileConnectUs />,
  },
]);

export default router;
